﻿
function copyToClipBoard(content)
{
    var clipBoardContent = "";
    clipBoardContent += content; //获取地址
    window.clipboardData.setData("Text", clipBoardContent);
    alert("复制成功，赶快分享给好友吧");
}

function copyindex()
{
    var index = document.getElementById("ctl00_ContentPlaceHolder1_txtIndex");
    var content = index.value;
    copyToClipBoard(content);
}

function copyregister()
{
    var register = document.getElementById("ctl00_ContentPlaceHolder1_txtRegister");
    var content = register.value;
    copyToClipBoard(content);
}

function copyrealmname()
{
    var realmname = document.getElementById("ctl00_ContentPlaceHolder1_lblRealmName");
    var content = realmname.innerText;
    copyToClipBoard(content);
}

//正整数
function checkRate(input)
{
    var re = /^[1-9]\d*$/;
    if (!re.test(input))
    {
        return false;
    }
    else
    {
        return true;
    }
}

//获取当前URL传递参数
function GetRequest()
{
    var url = location.search;
    var theRequest=new Object();
    if (url.indexOf("?") != -1)
    {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++)
        {
            theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
        }

        return theRequest;
    }
    else
    {
        return null;
    }

}

function getQueryString(name)
{
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null)
        return unescape(r[2]);
    return null;
}

function is_zimushuzi(obj)
{
    var reg;
    if (/^[A-Za-z0-9]+$/.test(obj))
    {
        return true;
    }
    else
    {
        return false;
    }
}